package com.example.demo.vo;

import com.diboot.core.binding.annotation.*;
import com.example.demo.entity.ProcurementStock;
import com.example.demo.entity.ProcurementOrderItem;
import com.example.demo.entity.Unit;
import com.diboot.iam.entity.IamUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import com.example.demo.entity.ProcurementOrder;
import com.example.demo.entity.Storeroom;
import com.example.demo.entity.Shelves;

/**
 * 采购库存 ListVO定义
 * @author MyName
 * @version 1.0
 * @date 2024-01-26
 * Copyright © MyCompany
 */
@Getter
@Setter
@Accessors(chain = true)
public class ProcurementStockListVO extends ProcurementStock {

    private static final long serialVersionUID = -3534151250530735802L;

    /**
     * 关联字段 采购单项.名称：ProcurementOrderItem.name
     */
    @BindField(entity = ProcurementOrderItem.class, field = "name", condition = "this.procurement_order_item_id=id")
    private String procurementOrderItemName;

    @BindField(entity = ProcurementOrder.class, field = "name", condition = "this.procurement_order_id=id")
    private String procurementOrderName;

    /**
     * 关联字段 单位.名称：Unit.name
     */
    @BindField(entity = Unit.class, field = "name", condition = "this.unit_id=id")
    private String unitName;

    /**
     * 关联字典：STOCKSTATUS
     */
    @BindDict(type = DICT_STOCKSTATUS, field = "status")
    private String statusLabel;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.update_by=id")
    private String updateByName;

    /**
     * 关联字段 采购单.采购员：ProcurementOrder.userName
     */
    @BindField(entity = ProcurementOrder.class, field = "iamUserId", condition = "this.procurement_order_id=id")
    private String procurementOrderUserName;

    /**
     * 关联对象 ：Shelves
     */
    @BindEntity(entity = Shelves.class, condition = "this.shelves_id=id")
    private Shelves shelves;

    /**
     * 关联字段 库房.名称：Storeroom.name
     */
    @BindField(entity = Storeroom.class, field = "name", condition = "this.storeroom_id=id")
    private String storeroomName;
}
